//
//  Digest.h
//  WangtianSoft
//
//  Created by mac on 15/3/3.
//  Copyright (c) 2015年 wangtiansoft. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <Security/Security.h>
#import "CocoaSecurity+PackgeExtensions.h"

@interface Digest : NSObject


#pragma mark - Instance Methods

-(void) loadPublicKeyFromFile: (NSString*) derFilePath;
-(void) loadPublicKeyFromData: (NSData*) derData;

-(void) loadPrivateKeyFromFile: (NSString*) p12FilePath password:(NSString*)p12Password;
-(void) loadPrivateKeyFromData: (NSData*) p12Data password:(NSString*)p12Password;


-(NSString*) rsaEncryptString:(NSString*)string;
-(NSData*) rsaEncryptData:(NSData*)data ;

-(NSString*) rsaDecryptString:(NSString*)string;
-(NSData*) rsaDecryptData:(NSData*)data;


#pragma mark - Class Methods

+ (Digest *)sharedInstance;

@end
